<?php

$fetch_cmd = "/home/luanjunyi/yhhd/py/taras/tools/fetch_action_count";
$log_path = "/home/luanjunyi/run/taras-sharded";

function fetch_action_count($email, $date) {
  global $fetch_cmd, $log_path;
  $cmd = sprintf("%s -p %s -u '%s' -d '%s'",
                 $fetch_cmd, $log_path, $email, $date);

  exec($cmd, $ret);
  if (count($ret) == 0 || $ret[0] <= 0) {
    return "N/A";
  } else {
    return $ret[0];
  }
}

$email = $_GET['email'];
$date = $_GET['date'];

echo fetch_action_count($email, $date);

?>


